import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

const route = [
  // 主页
  {
    path: '/',
    component: () => import('@/pages/index/index')
  },
  // 登录
  {
    path: '/login/:type',
    component: () => import('@/pages/login/index')
  },
  // 写文章
  {
    path: '/writeArticle',
    component: () => import('@/pages/writeArticle/index')
  },
  // 文章详情
  {
    path: '/detail/:id',
    name: 'detail',
    component: () => import('@/pages/detail/index')
  }
]
export default new Router({
  scrollBehavior: () => ({ y: 0 }),
  routes: route
})
